package Oss

import (
	"deepgox-go-admin/Settings"
	"fmt"
	"github.com/aliyun/aliyun-oss-go-sdk/oss"
)

var BucketObj *oss.Bucket

func Init(cfg *Settings.AliyunOssConfig) (err error) {
	OssClient, err := oss.New(
		cfg.Endpoint, cfg.AccessKeyId, cfg.AccessKeySecret,
	)
	BucketObj, err = OssClient.Bucket(cfg.Bucket)
	if err != nil {
		fmt.Println("Error:", err)
	}
	return err
}
